<template>
  <d2-container>
    <el-tabs v-model="activeName" @tab-click="handleClick">
    <el-tab-pane label="敞口管理" name="first">
       <v-glopen ref="child1"></v-glopen>
    </el-tab-pane>
    <el-tab-pane label="资金管理" name="second">
         <v-glfund ref="child2"></v-glfund>
    </el-tab-pane>
    <el-tab-pane label="费用管理" name="third">
      <v-glcost ref="child3"></v-glcost>
    </el-tab-pane>
  </el-tabs>
  </d2-container>
</template>
<style>
  .demo-table-expand {
    font-size: 0;
  }
  .demo-table-expand label {
    width: 90px;
    color: #99a9bf;
  }
  .demo-table-expand .el-form-item {
    margin-right: 0;
    margin-bottom: 0;
    width: 20%;
  }
</style>
<script>
import gl_fund from "./componnets/add/gl_fund.vue";
import gl_cost from "./componnets/add/gl_cost.vue";
import gl_open from "./componnets/add/gl_open.vue";
export default {
 components: {
   "v-glopen": gl_open,
    "v-glcost": gl_cost,
    "v-glfund": gl_fund,
    
  },
  data () {
    return {
        activeName: 'first',
        // gl_fund,
        gl_cost,
        gl_open,
    }
  },
  created() {
           this.tabledatas = [
               { title: '标题1', text: 's111sssa' },
               { title: '标题2', text: 'ss222ssa' },
           ]
           this.tabledatas.map(i => {
               i.show = false
               return i
           })
  },
  methods: {
    updateType() {
      let activeTab = this.$route.query.table;
      // 判断type的值，更改activeName的值
      if (activeTab === "first") {
        this.activeName = "first";
      } else if (activeTab === "second") {
        this.activeName = "second";
      } else if (activeTab === "third") {
        this.activeName = "third";
      }
    },
     handleClick(tab, event) {
        // console.log(tab, event);
    },
  },
  mounted() {
    this.updateType();
  //  this.XHCKChange()
  //  this.FYGLChange()
   }
  }
</script>
